Class RgbTile
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.world.tiles.Tile
-
- page.codeberg.terratactician_expandoria.world.tiles.RgbTile
-
public class RgbTile extends Tile
A rgb tile can be used in creative mode, for visual purposes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile
Tile.TileType
-
-
Constructor Summary
Constructors Constructor Description RgbTile()Creates a coordinate less rgb tile.RgbTile(CubeCoordinate coord)Creates a rgb tile with coordinates.RgbTile(CubeCoordinate coord, org.json.JSONObject data)Creates a rgb tiles with a coordinate and extra json meta data.RgbTile(RgbTile other)Create a copy/clone of a house.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tileclone()Creates a clone of the tile.java.lang.StringdataToString()Can be used by tile to add internal data to `toString`.java.lang.StringgetName()Name of Tile in Api interface.org.json.JSONObjectserializeData()Serializes extra Data of an Tile, to be send.RgbTilewithBlue(int b)Configure blue color channel value Will only be applied when placing the tile.RgbTilewithColors(int r, int g, int b)RgbTilewithGreen(int g)Configure green color channel value Will only be applied when placing the tile.RgbTilewithRed(int r)Configure red color channel value Will only be applied when placing the tile.-
Methods inherited from class page.codeberg.terratactician_expandoria.world.tiles.Tile
deserialize, deserialize, getCoordinate, getTileType, reclaimable, serialize, takeable, toString
-
-
-
-
Constructor Detail
-
RgbTile
public RgbTile()
Creates a coordinate less rgb tile.
-
RgbTile
public RgbTile(CubeCoordinate coord)
Creates a rgb tile with coordinates.- Parameters:
coord- coordinate of the rgb tile
-
RgbTile
public RgbTile(RgbTile other)
Create a copy/clone of a house.- Parameters:
other- tile to clone
-
RgbTile
public RgbTile(CubeCoordinate coord, org.json.JSONObject data)
Creates a rgb tiles with a coordinate and extra json meta data.- Parameters:
coord- coordinate of the tiledata- extra data
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from class:TileName of Tile in Api interface.
-
serializeData
public org.json.JSONObject serializeData()
Description copied from class:TileSerializes extra Data of an Tile, to be send.- Overrides:
serializeDatain classTile- Returns:
- null or JSONObject with at least a valid "type" field.
-
withRed
public RgbTile withRed(int r)
Configure red color channel value Will only be applied when placing the tile. UseConfigureRgbTileActionto change an existing tile.- Parameters:
r- red color value [0,255]- Returns:
- reference to this
-
withGreen
public RgbTile withGreen(int g)
Configure green color channel value Will only be applied when placing the tile. UseConfigureRgbTileActionto change an existing tile.- Parameters:
g- green color value [0,255]- Returns:
- reference to this
-
withBlue
public RgbTile withBlue(int b)
Configure blue color channel value Will only be applied when placing the tile. UseConfigureRgbTileActionto change an existing tile.- Parameters:
b- blue color value [0,255]- Returns:
- reference to this
-
withColors
public RgbTile withColors(int r, int g, int b)
Short hand for.withRed(r).withGreen(g).withBlue(b); Will only be applied when placing the tile. UseConfigureRgbTileActionto change an existing tile.- Parameters:
r- red color value [0,255]g- green color value [0,255]b- blue color value [0,255]- Returns:
- reference to this
-
dataToString
public java.lang.String dataToString()
Description copied from class:TileCan be used by tile to add internal data to `toString`. Returned string should start with: ", "- Overrides:
dataToStringin classTile- Returns:
- additional data stringified
-
-